
import axios from 'axios'

function encryptData(data){
    var encrypted;
    var rsaEncrypt = new JSEncrypt();
    rsaEncrypt.setPublicKey(publicKey);
    encrypted=rsaEncrypt.encrypt(data);   
    return encrypted;
}

const sign_data = getUuid()

const service = axios.create({
    baseURL: import.meta.env.VITE_APP_BASE_API, 
    timeout: 5000,
    headers: {
      'Content-Type': 'application/json;charset=UTF-8',
      'rsa_token': encryptData(sign_data),
      'sign_data': sign_data
    }
})

export default service